import request from '@/utils/request'

// 查询合同订单列表
export function listOrder(query) {
  return request({
    url: '/aftersales/order/list',
    method: 'get',
    params: query
  })
}

// 查询合同订单详细
export function getOrder(id) {
  return request({
    url: '/aftersales/order/' + id,
    method: 'get'
  })
}

// 新增合同订单
export function addOrder(data) {
  return request({
    url: '/aftersales/order',
    method: 'post',
    data: data
  })
}

// 修改合同订单
export function updateOrder(data) {
  return request({
    url: '/aftersales/order',
    method: 'put',
    data: data
  })
}

// 删除合同订单
export function delOrder(id) {
  return request({
    url: '/aftersales/order/' + id,
    method: 'delete'
  })
}

/**
 * 
 * 预约安装
 * @param {*} data 
 * @returns 
 */
export function installAgentAdd(data) {
  return request({
    url: '/aftersales/install/agentAdd',
    method: 'post',
    data: data
  })
}

/**
 * 
 * 预约维保
 * @param {*} data 
 * @returns 
 */
export function repairAgentAdd(data) {
  return request({
    url: '/aftersales/repair/agentAdd',
    method: 'post',
    data: data
  })
}
/**
 * 服务情况
 */
export function queryWorkOrder(query) {
  return request({
    url: '/aftersales/order/queryInstallAndRepair',
    method: 'get',
    params: query
  })
}